import sys
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import QPropertyAnimation, QSequentialAnimationGroup, QRect
from PyQt5.QtWidgets import QApplication, QWidget, QLabel


class Demo(QWidget):
    def __init__(self):
        super(Demo, self).__init__()
        self.resize(600, 600)
        # self.setStyleSheet("background-color:red;")

        self.plane = QLabel(self)
        self.plane.resize(50, 50)
        self.plane.setPixmap(QPixmap('plane.png').scaled(self.plane.size()))    # 1

        self.animation1 = QPropertyAnimation(self.plane, b'geometry')
        self.animation1.setDuration(2000)
        self.animation1.setStartValue(QRect(300, 500, 50, 50))
        self.animation1.setEndValue(QRect(200, 400, 50, 50))
        self.animation1.setLoopCount(1)

        self.animation2 = QPropertyAnimation(self.plane, b'geometry')
        self.animation2.setDuration(2000)
        self.animation2.setStartValue(QRect(200, 400, 50, 50))
        self.animation2.setEndValue(QRect(400, 300, 50, 50))
        self.animation2.setLoopCount(1)

        self.animation3 = QPropertyAnimation(self.plane, b'geometry')
        self.animation3.setDuration(2000)
        self.animation3.setStartValue(QRect(400, 300, 50, 50))
        self.animation3.setEndValue(QRect(200, 200, 50, 50))
        self.animation3.setLoopCount(1)

        self.animation_group = QSequentialAnimationGroup(self)                  # 2
        self.animation_group.addAnimation(self.animation1)
        self.animation_group.addPause(1000)
        self.animation_group.addAnimation(self.animation2)
        self.animation_group.addAnimation(self.animation3)
        self.animation_group.start()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    instance = Demo()
    # instance.show()
    # sys.exit(app.exec_())
    if instance is not None:
        app.setActiveWindow(instance)
        # instance.get_data_info(data)
        instance.show()
        try:
            sys.exit(app.exec_())
        except Exception as e:
            print(e)